Skip to content

Conversation

@tatethurston
Copy link

@tatethurston tatethurston commented Jun 14, 2024

This PR brings #45 up to date, dropping the previous error handling changes now that this library has dropped support for Rails < 6.

What is the current behavior?

What is the new behavior?

  • Accept a response status provided to the error render.
  • Fix the source pointer for errors on the model's base.

Checklist

Please make sure the following requirements are complete:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes /
    features)
  • All automated checks pass (CI/CD)

- Accept a response status provided to the error render.
- Fix the source pointer for errors on the model's base.
{ pointer: '/data' }
else
{ pointer: '' }
{ pointer: nil }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous discussion: #45 (comment)

pointer: '' references the document root, which strikes me as the wrong fallback behavior here?

Original commit: 43cbaee

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return an empty object, since there's no source to point to.

@stas
Copy link
Owner

stas commented Jun 23, 2024

Closing this in favor of #98

@stas stas closed this Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants